1. Field of the Invention
The present invention relates to image data compression, and more particularly to variable length image data compression method and apparatus capable of fixing constant length in units which contain the predetermined number of blocks so as to converge errors into the unit and determining the variable length of every block, which is contained in the unit, based on an optimal bit allocation selected according to the kind of image data.
2. Description of the Prior Art
For embodying home-use digital VCRs, it is essentially required to provide image data compression technologies for effectively compressing an enormous quantity of video signals without any degradation in picture quality, In digital VCRs, image data compression technologies should take into consideration such functions as variable speed playback and various editing capabilities, burst errors, and an error propagation, as compared with other image data compression fields such as communications. In particular, the length of encoded data should be fixed by blocks, in order to attain a reasonable picture quality in high speed playback and limit the error propagation to a suitable range while keeping the picture quality acceptable.
However, such a coding length should be adaptively varied, depending on the statistical characteristic of image, so as to obtain a high picture quality, because blocks of a frame are different in the statistical property, namely, the complexity of image. Accordingly, such a fixed length coding for the digital VCR image data compression has a problem of obtaining a poor picture quality, even though it is advantageous in error propagation and high speed playback.
Variable length coding has been also used for the digital VCR image data compression, in order to solve the problem encountered in the fixed length coding. However, such a variable length coding causes wide error propagations, even though it can provide an improvement in picture quality. In particular, the variable length coding has a serious problem of selecting a range at which the variable length is fixed for the high speed playback.
FIG. 1 is a block diagram of a conventional variable length coding apparatus for a general digital VCR. FIG. 2 is a block diagram of a bit rate reduction encoder which is denoted by the reference numeral 3. Now, a conventional variable length coding will be described, in conjunction with FIGS. 1 and 2.
Input signals which are inputted at the variable length coding apparatus and the bit rate reduction encoder are digital signals A/D converted by 8 bits. These digital signals are NTSC component image signals each including a luminance signal Y and two color difference signals C1 and C2 sampled at a rate of 4:1:1. In each NTSC component image signal, that is, the luminarice signal Y has a sampling frequency of 13.5 MHz and the difference signals C1 and C2 have sampling frequencies of 3.375 MHz. The input signal transmission rate through a channel is 162 Mbps.
The luminarice signal Y and difference signals C1 and C2 of input video signal are stored in a formatting memory 2 and then supplied to a bit rate reduction encoder 3. In the bit rabe reduction encoder 3, the input video signal including the signals Y, C1 and C2 are compressed to 19 Mbps. These compressed data are inputted at an error-correcting code (ECC) encoder 4 and added with additional bits, to be error-correcting encoded. The data from the ECC encoder 4 is then formed into a so-called sync-block with identification (ID)-information and synchronization-pattern. The sync-block is then recorded on the tape at 27 Mbps with audio signals.
In case of the apparatus shown in FIG. 2, the input video signals Y, C1 and C2 which are inputted at the formatting memory 2. In the formatting memory 2, the input frame is partitioned into macroblocks each containing 8.times.8 blocks, namely, pixels, as shown in FIG. 3. An DCT(Discrete Cosine Transform) operation is then independently carried out for every pixel, in a modified DCT unit 3A. DCT coefficients obtained in the modified DCT unit 3A are stored in a buffer memory 3B during when a data quantity estimator 30 selects an optimum quantizer.
The data quantity estimator 3C serves to select an optimal quantizer generating minimum errors within a number of bits (for example, 64 bits upon 1/8 compression) allocated to each block, from the prepared quantizers. Accordingly, the coding of each block can be carried out, with the fixed length allocated to the block. The DCT coefficients are quantized by a selected quantizer in a quantization unit 3D and then Huffman-encoded in an encoder unit 3E.
As mentioned above, the conventional image data compression method achieves a image data compression by dividing image signals indicative of a frame into blocks. In this method, the length of data used for achieving a coding for each block is fixed. Basically, the error propagation is converged into blocks, in conventional fixed length coding methods. However, it is inefficient to limit the length of data for achieving a coding to a fixed length for all blocks, because the statistical characteristic is variable, even in one frame. It is true that where the statistical characteristic of image data is constant, the fixed length coding is advantageous, in terms of the error propagation and the high speed playback. However, an efficient image data compression needs the use of the variable length coding method. Accordingly, conventional methods should make a compromise between the above-mentioned contrary requirements. However, there has been no method capable of making such a compromise yet.